﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Dapper;

namespace PhoneCard.DAL
{
    public partial class UsersDAL
    {
        public string ConnStr { set; get; }

        public List<Entities.User> GetListUser(string strWhere)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select * ");
            strSql.Append(" FROM `users` ");
            if (strWhere.Trim() != "")
            {
                strSql.Append(" where " + strWhere);
            }
            List<Entities.User> list = new List<Entities.User>();
            using (var connection = ConnectionFactory.GetOpenConnection(ConnStr))
            {
                list = connection.Query<Entities.User>(strSql.ToString()).ToList();

            }
            return list;
        }

    }
}
